<!-- 普通用户信息 -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>
        back_blog - <%= title %>
    </title>
</head>
<link rel="shortcut icon" href="./images/favicon.ico">
<link rel="stylesheet" href="./bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="./stylesheets/public.css">
<link rel="stylesheet" href="./stylesheets/authorinfo.css">

<body>
    <div class="blogwrap">
        <%- include head %>
            <div class="navbarconent col-md-12 col-sm-12 col-xs-12">
                <div class="boxContent">
                    <div class="navtitle clearfix">
                        <ol class="breadcrumb">
                            <li><a href="/">主页</a></li>
                            <li><a href="/authorinfo">个人信息</a></li>
                        </ol>
                    </div>
                    <div class="form-group clearfix">
                        <div class="authorimg">
                            <label class="col-md-2 col-sm-3  col-xs-5">用户头像:</label>
                            <div class="col-md-10 col-sm-9  col-xs-7">
                                <img src="<%=authorResult.headImg%>" alt="authorinfo" name="headImg">
                            </div>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <div class="authorname">
                            <label class="col-md-2 col-sm-3 col-xs-5">用户名：</label>
                            <div class="col-md-10 col-sm-9  col-xs-7">
                                <b>
                                    <%= authorResult.author %>
                                </b>
                            </div>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <div class="email">
                            <label class="col-md-2 col-sm-3 col-xs-5">邮箱：</label>
                            <div class="col-md-10 col-sm-9  col-xs-7">
                                <%= authorResult.email %>
                            </div>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <div class="motto">
                            <label class="col-md-2 col-sm-3  col-xs-5">座右铭：</label>
                            <div class="col-md-10 col-sm-9  col-xs-7">
                                <ul>
                                    <% for(let i=0; i < authorResult.motto.length; i++) {%>
                                        <li>
                                            <%= authorResult.motto[i]%>
                                        </li>
                                        <%}%>
                                </ul>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <div class="caozuo">
                                <label class="col-md-2 col-sm-3  col-xs-5">操作：</label>
                                <div class="col-md-10 col-sm-9  col-xs-7">
                                    <a id="toupdate" title="修改用户信息" type="button" class="btn btn-primary">信息更正</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="updateauthorInfo  col-lg-6 col-lg-offset-3  col-sm-6 col-sm-offset-3 col-xs-12">
                <div class="title">
                    <span>修改信息</span>
                    <i class="glyphicon glyphicon-remove-sign" id="close" title="关闭窗口"></i>
                </div>
                <div class="content">
                    <form action="/updateauthorinfo" enctype="multipart/form-data" method="post">
                        <input type="hidden" name="authorid" value="<%=authorResult._id%>" />
                        <div class="form-group clearfix">
                            <label class="col-md-2 col-sm-2">用户名:</label>
                            <div class="col-md-10 col-sm-10">
                                <input type="text" class="form-control" id="authorname" placeholder="请输入用户名"
                                    name="authorname" value="<%= authorResult.author%>">
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="col-md-2 col-sm-2">邮箱:</label>
                            <div class="col-md-10 col-sm-10">
                                <input type="text" class="form-control" name="email" id="email" placeholder="请输入邮箱"
                                    value="<%= authorResult.email%>">
                                <input type="button" class="form-control" id="send" value="send">
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="col-md-2 col-sm-2">验证码:</label>
                            <div class="col-md-10 col-sm-10">
                                <input name="yzm" type="text" class="form-control" id="s_yzm" placeholder="请输入验证码" />
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="col-md-2 col-sm-2">原密码:</label>
                            <div class="col-md-10 col-sm-10">
                                <input type="password" class="form-control" id="password" placeholder="请输入原密码"
                                    name="password">
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="col-md-2 col-sm-2">新密码:</label>
                            <div class="col-md-10 col-sm-10">
                                <input type="password" class="form-control" id="password2" placeholder="请输入新密码"
                                    name="password2">
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="col-md-2 col-sm-2">座右铭:</label>
                            <div class="col-md-10 col-sm-10">
                                <input type="hidden" name="authormotto" value="<%=authorResult.motto%>" id="authormotto" />
                                <textarea class="form-control" rows="3" id="motto" name="motto"
                                    title="建议座右铭每句以英文逗号隔开"></textarea>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="col-md-2 col-sm-2">原头像:</label>
                            <div class="filebox col-md-10 col-sm-10">
                                <input type="hidden" name="authoroldimg" value="<%=authorResult.headImg%>" />
                                <img src="<%= authorResult.headImg%>" />
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="col-md-2 col-sm-2">新头像:</label>
                            <div class="filebox col-md-10 col-sm-10">
                                <input type="file" accept="image/*" id='inputfile' name="headImg" />
                                <img src="" id='willsetImg' />
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <div class="col-md-12 col-sm-12">
                                <input class="btn btn2 btn-primary" type="submit" title="确认更改"></input>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

    </div>
</body>
<script src="./javascripts/jquery.min.js"></script>
<script src="./bootstrap/js/bootstrap.min.js"></script>
<script src="./javascripts/sweetalert2@8.js"></script>
<script src="./javascripts/authorinfo.js"></script>

</html>